import { ref } from "vue"

export default {
    data() {
        return {}
    },
    //分享小程序
    onShareAppMessage(e) {
		const id = uni.getStorageSync('userInfo')
		console.log('分享id',id.id)
		const identify = id.identify
		const title = ref('分享')
		const desc = ref('西望')
		const path = ref('/pages/home/index')
        if (identify == 2||identify == 4) {
            console.log('来自页面内转发按钮');
			title.value = '分享返利'
			desc.value = '分享返利-邀请更多朋友'
			path.value ='/pages/home/index?id='+id.id
        } else {
            console.log('分享权限不足');
        }
        return {
            // 自定义分享内容
            title: title.value,
            desc: desc.value,
            path: path.value, // 路径，可传递参数到指定页面
        };
    },
    // 分享到朋友圈
    onShareTimeline() {
        return {
            title:  title.value,
            path: path.value
        };
    },
}